home *** CD-ROM | disk | FTP | other *** search
/ Aminet 6 / Aminet 6 - June 1995.iso / Aminet / gfx / 3d / irit50src.lha / irit5 / include / priorque.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-22  |  1.2 KB  |  37 lines

  1. /*****************************************************************************
  2. * Definitions, visible to others, of Priority Queue module:             *
  3. *****************************************************************************/
  4.  
  5. #ifndef PRIOR_Q_GH
  6. #define PRIOR_Q_GH
  7.  
  8. typedef struct PriorQue {
  9.     struct PriorQue *Right, *Left;     /* Pointers to two sons of this node. */
  10.     VoidPtr Data;                 /* Pointers to the data itself. */
  11. } PriorQue;
  12.  
  13. typedef int (*PQCompFuncType)(VoidPtr, VoidPtr);     /* Comparison function. */
  14.  
  15. #if defined(__cplusplus) || defined(c_plusplus)
  16. extern "C" {
  17. #endif
  18.  
  19. /* And global function prototypes: */
  20. void PQInit(PriorQue **PQ);
  21. int PQEmpty(PriorQue *PQ);
  22. void PQCompFunc(PQCompFuncType NewCompFunc);
  23. VoidPtr PQFirst(PriorQue **PQ, int Delete);
  24. VoidPtr PQInsert(PriorQue **PQ, VoidPtr NewItem);
  25. VoidPtr PQDelete(PriorQue **PQ, VoidPtr NewItem);
  26. VoidPtr PQFind(PriorQue *PQ, VoidPtr OldItem);
  27. VoidPtr PQNext(PriorQue *PQ, VoidPtr CmpItem, VoidPtr BiggerThan);
  28. void PQPrint(PriorQue *PQ, void (*PrintFunc)(VoidPtr));
  29. void PQFree(PriorQue *PQ, int FreeItems);
  30. void PQFreeFunc(PriorQue *PQ, void (*FreeFunc)(VoidPtr));
  31.  
  32. #if defined(__cplusplus) || defined(c_plusplus)
  33. }
  34. #endif
  35.  
  36. #endif /* PRIOR_Q_GH */
  37.